package com.nlgc365.designpattern.Chapter04_Pattern.Behavior.P02_Template.Callback;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class CallBackSomeCase {
    private static final Logger logger = LoggerFactory.getLogger(CallBackSomeCase.class);

    public final void templateMethod1(SomeMethod method1, SomeMethod method2) {
        logger.info("模板方法1: 开始");
        method1.execute();
        logger.info("模板方法1: 中间");
        method2.execute();
        logger.info("模板方法1: 结束");
    }

    public final void templateMethod2(SomeMethod method1, SomeMethod method2) {
        logger.info("模板方法2: 开始");
        method1.execute();
        logger.info("模板方法2: 开始");
        method2.execute();
        logger.info("模板方法2: 开始");
    }
}
